// Package _6___II__数组中数字出现的次数_II main
// @Title _6___II__数组中数字出现的次数_II
// @Description
// @Author  == 琳琳也叫王木木 ==  2022-02-11 12:21
// @Create  2022-02-11 12:21
package main

import "fmt"

func singleNumber(nums []int) int {
	hashMap := make(map[int]int)
	for i := 0; i < len(nums); i++ {
		//hashMap[nums[i]] = 2
		_, v := hashMap[nums[i]]
		if v {
			hashMap[nums[i]] += 1
		} else {
			hashMap[nums[i]] = 1
		}
	}
	for k, v := range hashMap {
		if v == 1 {
			return k
		}
	}
	return 0
}

func main() {
	fmt.Println(singleNumber([]int{3, 4, 3, 3}))
}
